gRPC: Up and Running by Danesh Kuruppu & Kasun Indrasiri
Author:Danesh Kuruppu & Kasun Indrasiri [Danesh Kuruppu]
Language: eng
Format: epub
Publisher: O'Reilly Media, Inc.
Published: 2020-01-29T16:00:00+00:00
Example 5-5. gRPC deadlines for the client application
conn, err := grpc.Dial(address, grpc.WithInsecure()) if err != nil { log.Fatalf("did not connect: %v", err) } defer conn.Close() client := pb.NewOrderManagementClient(conn) clientDeadline := time.Now().Add( time.Duration(2 * time.Second)) ctx, cancel := context.WithDeadline( context.Background(), clientDeadline) defer cancel() // Add Order order1 := pb.Order{Id: "101", Items:[]string{"iPhone XS", "Mac Book Pro"}, Destination:"San Jose, CA", Price:2300.00} res, addErr := client.AddOrder(ctx, &order1) if addErr != nil { got := status.Code(addErr) log.Printf("Error Occured -> addOrder : , %v:", got) } else { log.Print("AddOrder Response -> ", res.Value) }
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Embedded Programming with Modern C++ Cookbook by Igor Viarheichyk(4028)
Linux Device Driver Development Cookbook by Rodolfo Giometti(4006)
Implementing Cellular IoT Solutions for Digital Transformation by Dennis McCain(3957)
Embedded Linux Development Using Yocto Project - Third Edition by Otavio Salvador & Daiane Angolini(3815)
TinyML Cookbook by Gian Marco Iodice(3710)
Simplifying 3D Printing with OpenSCAD by Colin Dow(2891)
TinyML Cookbook by Gian Marco Iodice & Ronan Naughton(2649)
Fusion 360 for Makers by Lydia Sloan Cline(2294)
Networking A Beginner's Guide by Bruce Hallberg(2270)
Hands-On Linux for Architects by Denis Salamanca(2119)
Computers For Seniors For Dummies by Nancy C. Muir(2092)
But How Do It Know? by J. Clark Scott(2068)
Raspberry Pi and MQTT Essentials by Dhairya Parikh(2021)
Arduino Project Handbook, Volume 2: 25 Simple Electronics Projects for Beginners by Geddes Mark(1988)
9781803246888-ENHANCING DEEP LEARNING WITH BAYESIAN INFERENCE by Unknown(1954)
Hack and HHVM by Owen Yamauchi(1938)
31 Days Before Your CompTIA A+ Exams (Shanette Luellen's Library) by Benjamin Patrick Conry(1909)
Hands-On Internet of Things with MQTT by Tim Pulver(1812)
MicroPython Projects by Jacob Beningo(1806)